package com.data.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.data.serivce.IPlayerService;
import com.data.serivce.Impl.PlayerDBService;


public class BeanFactory {
	public static IPlayerService PlayerService = null;
	private static ApplicationContext appCtx = null;

	public static ApplicationContext getBeanFactory() {
		if (appCtx == null) {
			appCtx = new ClassPathXmlApplicationContext("/com/data/spring/applicationContext.xml");
			PlayerService = (IPlayerService) appCtx.getBean("PlayerService");
		}
		return appCtx;
	}
}
